<?php
namespace Home\Controller;
use Think\Controller;
class TrainController extends Controller {
    public function getTrains(){

        // $m_id = $_GET['m_id'];

        $trains = M('trains');
        $data = $trains -> order("train_id")->select();

        echo json_encode($data);
         echo "<br>";

    }
    public function getTrainById(){


        $getTrainById = M('trains');
        $data = $getTrainById -> find($train_id);

        echo json_encode($data);
         echo "<br>";

    }
}
?>